﻿<Window x:Class="LongBar.LongBarMain"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="LongBar" Height="500" Width="150" ResizeMode="NoResize" Opacity="1" WindowStyle="None"
    Background="Transparent" ShowInTaskbar="False" AllowsTransparency="True"
    AllowDrop="True" SizeChanged="Window_SizeChanged" Activated="LongBar_Activated" Deactivated="Window_Deactivated">
    <Window.Resources>
        <DoubleAnimation x:Key="LoadAnimOffset" Storyboard.TargetName="OpacityMaskGradStop" BeginTime="0:0:0.05" Storyboard.TargetProperty="Offset" To="0" Duration="0:0:0.25"/>
        <DoubleAnimation x:Key="LoadAnimOffset1" Storyboard.TargetName="OpacityMaskGradStop1" Storyboard.TargetProperty="Offset" To="0" Duration="0:0:0.25" Completed="LoadAnimation_Completed"/>
        <DoubleAnimation x:Key="DummyAnim" Duration="0:0:0.5" Completed="DummyAnimation_Completed"/>
    </Window.Resources>
    <Window.OpacityMask>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop x:Name="null" Color="#00000000" Offset="0"/>
            <GradientStop x:Name="OpacityMaskGradStop1" Color="#00000000" Offset="1"/>
            <GradientStop x:Name="OpacityMaskGradStop" Color="#FF000000" Offset="1"/>
            <GradientStop Color="#FFFFFFFF" Offset="1"/>
        </LinearGradientBrush>
    </Window.OpacityMask>
    <Window.ContextMenu>
        <ContextMenu Name="Menu" HasDropShadow="True" Opened="Menu_Opened">
            <MenuItem Name="LockItem" Header="{DynamicResource Lock}" Click="LockItem_Click"/>
            <MenuItem Name="MinimizeItem" Header="{DynamicResource Minimize}" Click="MinimizeItem_Click"/>
            <MenuItem Name="SettingsItem" Header="{DynamicResource Settings}" Click="SettingsItem_Click"/>
            <MenuItem Name="SetSideItem" Header="{DynamicResource SetSide}">
                <MenuItem Name="LeftSideItem" Header="{DynamicResource Left}" Click="LeftSideItem_Click"/>
                <MenuItem Name="RightSideItem" Header="{DynamicResource Right}" Click="RightSideItem_Click"/>
            </MenuItem>
            <MenuItem Name="AddTileItem" Header="{DynamicResource AddTile}"/>
            <MenuItem Name="RemoveTilesItem" Header="{DynamicResource RemoveTiles}" Click="RemoveTilesItem_Click"/>
            <MenuItem Name="GetTilesItem" Header="{DynamicResource GetTiles}" Click="GetTilesItem_Click"/>
            <MenuItem Name="CloseItem" Header="{DynamicResource Close}" Click="CloseItem_Click"/>
        </ContextMenu>
    </Window.ContextMenu>
    <Grid>
        <Rectangle Name="Bg" Style="{DynamicResource Background}"/>
        <Image Name="BackgroundImage" Style="{DynamicResource BackgroundImage}"/>
        <Rectangle Name="BgHighlight" Style="{DynamicResource BackgroundHighlight}"/>
        
        <StackPanel Name="Splitter" Style="{DynamicResource SysMenuSplitter}">
            <Line Name="SplitterLine1" Style="{DynamicResource TileSplitterLine1}"/>
            <Line Name="SplitterLine2" Style="{DynamicResource TileSplitterLine2}"/>
        </StackPanel>

        <Canvas x:Name="SnowFallCanvas" Visibility="Collapsed"/>
        
        <DockPanel  Name="MainPanel" Style="{DynamicResource MainPanel}">
            <StackPanel Name="PinGrid" Style="{DynamicResource PinGrid}"/>
            <StackPanel  Name="TilesGrid" Style="{DynamicResource TilesPanel}"/>
        </DockPanel>
        <Rectangle Name="Highlight" Style="{DynamicResource Highlight}"/>
        <StackPanel Name="SysMenu" Style="{DynamicResource SysMenu}">
            <StackPanel.Triggers>
                <EventTrigger RoutedEvent="StackPanel.MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="DropDownButtonFill" Storyboard.TargetProperty="Color" To="White" Duration="0:0:0.3"/>
                            <DoubleAnimation Storyboard.TargetName="DropDownTextBlock" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.3"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="StackPanel.MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Storyboard.TargetName="DropDownButtonFill" Storyboard.TargetProperty="Color" To="{DynamicResource MenuButtonFillColor}" Duration="0:0:0.3"/>
                            <DoubleAnimation Storyboard.TargetName="DropDownTextBlock" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.3"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </StackPanel.Triggers>
            <Polygon Name="DropDownButton" Style="{DynamicResource MenuButton}" MouseLeftButtonDown="DropDownMenu_MouseLeftButtonDown">
                <Polygon.Fill>
                    <SolidColorBrush x:Name="DropDownButtonFill" Color="{DynamicResource MenuButtonFillColor}"/>
                </Polygon.Fill>
            </Polygon>
            <TextBlock Name="DropDownTextBlock" Style="{DynamicResource MenuButtonText}"  Text="{DynamicResource Options}" MouseLeftButtonDown="DropDownMenu_MouseLeftButtonDown"/>
        </StackPanel>
    </Grid>
</Window>
